package com.cbs.android.extension.glide.urlloader.qiniu;

import com.cbs.android.component.log.L;

/**
 * Created by broche on 04/11/2016.
 */

public abstract class QiniuUrl {
    private static final String TAG = QiniuUrl.class.getName();
    private String url;
    private boolean debug = false;

    public QiniuUrl(String url) {
        this.url = url;
    }

    public QiniuUrl(String url, boolean debug) {
        this.url = url;
        this.debug = debug;
    }

    protected abstract String buildUrl(String url, int width, int height);

    public String build(int width, int height) {
        String res = buildUrl(url, width, height);
        if (debug) {
            L.e(TAG, "QiniuUrl: " + res);
        }
        return res;
    }
}
